package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the ORGANIZATION database table.
 * 
 */
@Entity
@NamedQuery(name="Organization.findAll", query="SELECT o FROM Organization o")
public class Organization implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="ORGANIZATION_ORGANIID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ORGANIZATION_ORGANIID_GENERATOR")
	@Column(name="ORGANI_ID")
	private long organiId;

	@Column(name="ORGANI_ENDTIME")
	private Timestamp organiEndtime;

	@Column(name="ORGANI_NAME")
	private String organiName;

	@Column(name="ORGANI_PERSON")
	private String organiPerson;

	@Column(name="ORGANI_REMARKS")
	private String organiRemarks;

	@Column(name="ORGANI_TIME")
	private Timestamp organiTime;

	//bi-directional many-to-one association to OrganizationArea
	@ManyToOne
	@JoinColumn(name="ORGAREA_ID1")
	private OrganizationArea organizationArea;

	//bi-directional many-to-one association to Position
	@OneToMany(mappedBy="organization")
	@JSONField(serialize=false)
	private List<Position> positions;

	//bi-directional many-to-one association to Recruitapply
	@OneToMany(mappedBy="organization")
	@JSONField(serialize=false)
	private List<Recruitapply> recruitapplies;

	//bi-directional many-to-one association to Recruitplan
	@OneToMany(mappedBy="organization")
	@JSONField(serialize=false)
	private List<Recruitplan> recruitplans;

	public Organization() {
	}

	public long getOrganiId() {
		return this.organiId;
	}

	public void setOrganiId(long organiId) {
		this.organiId = organiId;
	}

	public Timestamp getOrganiEndtime() {
		return this.organiEndtime;
	}

	public void setOrganiEndtime(Timestamp organiEndtime) {
		this.organiEndtime = organiEndtime;
	}

	public String getOrganiName() {
		return this.organiName;
	}

	public void setOrganiName(String organiName) {
		this.organiName = organiName;
	}

	public String getOrganiPerson() {
		return this.organiPerson;
	}

	public void setOrganiPerson(String organiPerson) {
		this.organiPerson = organiPerson;
	}

	public String getOrganiRemarks() {
		return this.organiRemarks;
	}

	public void setOrganiRemarks(String organiRemarks) {
		this.organiRemarks = organiRemarks;
	}

	public Timestamp getOrganiTime() {
		return this.organiTime;
	}

	public void setOrganiTime(Timestamp organiTime) {
		this.organiTime = organiTime;
	}

	public OrganizationArea getOrganizationArea() {
		return this.organizationArea;
	}

	public void setOrganizationArea(OrganizationArea organizationArea) {
		this.organizationArea = organizationArea;
	}

	public List<Position> getPositions() {
		return this.positions;
	}

	public void setPositions(List<Position> positions) {
		this.positions = positions;
	}

	public Position addPosition(Position position) {
		getPositions().add(position);
		position.setOrganization(this);

		return position;
	}

	public Position removePosition(Position position) {
		getPositions().remove(position);
		position.setOrganization(null);

		return position;
	}

	public List<Recruitapply> getRecruitapplies() {
		return this.recruitapplies;
	}

	public void setRecruitapplies(List<Recruitapply> recruitapplies) {
		this.recruitapplies = recruitapplies;
	}

	public Recruitapply addRecruitapply(Recruitapply recruitapply) {
		getRecruitapplies().add(recruitapply);
		recruitapply.setOrganization(this);

		return recruitapply;
	}

	public Recruitapply removeRecruitapply(Recruitapply recruitapply) {
		getRecruitapplies().remove(recruitapply);
		recruitapply.setOrganization(null);

		return recruitapply;
	}

	public List<Recruitplan> getRecruitplans() {
		return this.recruitplans;
	}

	public void setRecruitplans(List<Recruitplan> recruitplans) {
		this.recruitplans = recruitplans;
	}

	public Recruitplan addRecruitplan(Recruitplan recruitplan) {
		getRecruitplans().add(recruitplan);
		recruitplan.setOrganization(this);

		return recruitplan;
	}

	public Recruitplan removeRecruitplan(Recruitplan recruitplan) {
		getRecruitplans().remove(recruitplan);
		recruitplan.setOrganization(null);

		return recruitplan;
	}

}